<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>图书馆管理系统 - 注册</title>
    <style>
        body { font-family: Arial, sans-serif; }
        .container { width: 300px; margin: 0 auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; margin-top: 50px; }
        .error { color: red; }
    </style>
</head>
<body>
    <div class="container">
        <h2>注册</h2>
        <form action="register" method="post">
            <div>
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div>
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div>
                <label for="email">邮箱:</label>
                <input type="email" id="email" name="email" required>
            </div>
            <div>
                <button type="submit">注册</button>
            </div>
        </form>
        <p>已有账号? <a href="login.jsp">登录</a></p>
        <% if (request.getAttribute("error") != null) { %>
            <p class="error"><%= request.getAttribute("error") %></p>
        <% } %>
    </div>
</body>
</html>    